#ifndef TD_MARIO_INFO_PANEL_H_
#define TD_MARIO_INFO_PANEL_H_

/************************************************************************/
/* PROJECT                                                              */
/************************************************************************/

/************************************************************************/
/* GUI                                                                  */
/************************************************************************/
#include "GUI/Panels/BasePanel.h"

/************************************************************************/
/* Resources                                                            */
/************************************************************************/
#include "Resources/ResourceManager.h"


using namespace std;
using namespace boost;

namespace TD_GUI {

	class MarioInfoPanel : public BasePanel {

		/************************************************************************/
		/* Default definitions                                                  */
		/************************************************************************/
		static const string m_creepInfoBackground;
		static const Coord2D m_infoPanelPosition;
		static const Coord2D m_infoPanelSize;

		map<marioTypes, string> m_marioNames;

		BaseMario * m_pCreep;
		

		string m_creepName;
		
		int m_lastCreepLife;

		/** Text boxes: */
		TextMessage *m_pCreepName;
		TextMessage *m_pCreepGold;
		TextMessage *m_pCreepLife;
		TextMessage *m_pCreepSpeed;


	public:
		

		/************************************************************************/
		/* ctors and dtors					                                    */
		/************************************************************************/
		//Default constructor
		explicit MarioInfoPanel();

		//Copy constructor
		explicit MarioInfoPanel(const MarioInfoPanel &rhs);

		//Assignment constructor
		MarioInfoPanel& operator=(const MarioInfoPanel &rhs);

		//Destructor
		~MarioInfoPanel();

		/************************************************************************/
		/* Rendering                                                            */
		/************************************************************************/
		void render(SDL_Surface *const g_destSurface, unsigned int deltaTime);

		interaction_t processEvent(const SDL_Event &event);

		inline void setTargetCreep(BaseMario *g_pCreep) {
			m_pCreep = g_pCreep;
			updateCreepInfo();
		}

		void initalizeMarioNames();

		inline void updateCreepInfo() {
			if(m_pCreep != NULL) {
				m_lastCreepLife = m_pCreep->getLife();
				if(m_lastCreepLife < 0) {
					m_lastCreepLife = 0;
				}

				m_pCreepName->setText("Mario");
				m_pCreepLife->setText(intToStr(m_lastCreepLife));
				m_pCreepGold->setText(intToStr(m_pCreep->getGold()));
				m_pCreepSpeed->setText(intToStr(100));
			}
		}
	};
}


#endif